package com.demo.springbooot_demo.repository;

import com.demo.springbooot_demo.pojo.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends CrudRepository<User,Integer> {
    @Query("SELECT u FROM User u WHERE u.userName = ?1")
    Optional<User> findByUserName(String username);
}
